.class public Les/i7;
.super Lcom/android/volley/Request;
.source "FileDownloadRequest.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Les/i7$d;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/android/volley/Request<",
        "Ljava/lang/Void;",
        ">;"
    }
.end annotation


# instance fields
.field private q:Les/i7$d;

.field private r:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private s:Ljava/io/File;

.field private t:Ljava/io/File;


# direct methods
.method public constructor <init>(ILjava/lang/String;Ljava/io/File;Les/i7$d;Lcom/android/volley/j$a;)V
    .locals 0

    .line 2
    invoke-direct {p0, p1, p2, p5}, Lcom/android/volley/Request;-><init>(ILjava/lang/String;Lcom/android/volley/j$a;)V

    .line 3
    iput-object p4, p0, Les/i7;->q:Les/i7$d;

    .line 4
    iput-object p3, p0, Les/i7;->t:Ljava/io/File;

    .line 5
    new-instance p1, Ljava/io/File;

    new-instance p2, Ljava/lang/StringBuilder;

    invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    const-string p3, ".recf"

    invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    invoke-direct {p1, p2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    iput-object p1, p0, Les/i7;->s:Ljava/io/File;

    .line 6
    new-instance p1, Ljava/util/HashMap;

    invoke-direct {p1}, Ljava/util/HashMap;-><init>()V

    iput-object p1, p0, Les/i7;->r:Ljava/util/Map;

    return-void
.end method

.method public constructor <init>(Ljava/lang/String;Ljava/io/File;Les/i7$d;Lcom/android/volley/j$a;)V
    .locals 6

    const/4 v1, 0x0

    move-object v0, p0

    move-object v2, p1

    move-object v3, p2

    move-object v4, p3

    move-object v5, p4

    .line 1
    invoke-direct/range {v0 .. v5}, Les/i7;-><init>(ILjava/lang/String;Ljava/io/File;Les/i7$d;Lcom/android/volley/j$a;)V

    return-void
.end method

.method private A()V
    .locals 1

    .line 1
    new-instance v0, Les/i7$b;

    invoke-direct {v0, p0}, Les/i7$b;-><init>(Les/i7;)V

    invoke-static {v0}, Les/xc;->b(Ljava/lang/Runnable;)V

    return-void
.end method

.method private B()V
    .locals 1

    .line 1
    new-instance v0, Les/i7$c;

    invoke-direct {v0, p0}, Les/i7$c;-><init>(Les/i7;)V

    invoke-static {v0}, Les/xc;->b(Ljava/lang/Runnable;)V

    return-void
.end method

.method static synthetic a(Les/i7;)Les/i7$d;
    .locals 0

    .line 1
    iget-object p0, p0, Les/i7;->q:Les/i7$d;

    return-object p0
.end method

.method private a(JJ)V
    .locals 7

    .line 53
    new-instance v6, Les/i7$a;

    move-object v0, v6

    move-object v1, p0

    move-wide v2, p3

    move-wide v4, p1

    invoke-direct/range {v0 .. v5}, Les/i7$a;-><init>(Les/i7;JJ)V

    invoke-static {v6}, Les/xc;->b(Ljava/lang/Runnable;)V

    return-void
.end method

.method static synthetic b(Les/i7;)Ljava/io/File;
    .locals 0

    .line 1
    iget-object p0, p0, Les/i7;->t:Ljava/io/File;

    return-object p0
.end method


# virtual methods
.method protected a(Lcom/android/volley/h;)Lcom/android/volley/j;
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/android/volley/h;",
            ")",
            "Lcom/android/volley/j<",
            "Ljava/lang/Void;",
            ">;"
        }
    .end annotation

    .line 44
    invoke-virtual {p0}, Lcom/android/volley/Request;->u()Z

    move-result p1

    if-nez p1, :cond_2

    .line 45
    iget-object p1, p0, Les/i7;->s:Ljava/io/File;

    if-eqz p1, :cond_1

    invoke-virtual {p1}, Ljava/io/File;->length()J

    move-result-wide v0

    const-wide/16 v2, 0x0

    cmp-long p1, v0, v2

    if-lez p1, :cond_1

    .line 46
    iget-object p1, p0, Les/i7;->s:Ljava/io/File;

    iget-object v0, p0, Les/i7;->t:Ljava/io/File;

    invoke-virtual {p1, v0}, Ljava/io/File;->renameTo(Ljava/io/File;)Z

    move-result p1

    if-eqz p1, :cond_0

    const/4 p1, 0x0

    .line 47
    invoke-static {p1, p1}, Lcom/android/volley/j;->a(Ljava/lang/Object;Lcom/android/volley/a$a;)Lcom/android/volley/j;

    move-result-object p1

    return-object p1

    .line 48
    :cond_0
    new-instance p1, Lcom/android/volley/VolleyError;

    const-string v0, "Can\'t rename the download tmp file!"

    invoke-direct {p1, v0}, Lcom/android/volley/VolleyError;-><init>(Ljava/lang/String;)V

    invoke-static {p1}, Lcom/android/volley/j;->a(Lcom/android/volley/VolleyError;)Lcom/android/volley/j;

    move-result-object p1

    return-object p1

    .line 49
    :cond_1
    new-instance p1, Lcom/android/volley/VolleyError;

    const-string v0, "Tmp file is null!"

    invoke-direct {p1, v0}, Lcom/android/volley/VolleyError;-><init>(Ljava/lang/String;)V

    invoke-static {p1}, Lcom/android/volley/j;->a(Lcom/android/volley/VolleyError;)Lcom/android/volley/j;

    move-result-object p1

    return-object p1

    .line 50
    :cond_2
    new-instance p1, Lcom/android/volley/VolleyError;

    const-string v0, "Request is canceled!"

    invoke-direct {p1, v0}, Lcom/android/volley/VolleyError;-><init>(Ljava/lang/String;)V

    invoke-static {p1}, Lcom/android/volley/j;->a(Lcom/android/volley/VolleyError;)Lcom/android/volley/j;

    move-result-object p1

    return-object p1
.end method

.method protected bridge synthetic a(Ljava/lang/Object;)V
    .locals 0

    .line 2
    check-cast p1, Ljava/lang/Void;

    invoke-virtual {p0, p1}, Les/i7;->a(Ljava/lang/Void;)V

    return-void
.end method

.method protected a(Ljava/lang/Void;)V
    .locals 1

    const-string p1, "AudioDownloadRequest"

    const-string v0, "deliverResponse"

    .line 51
    invoke-static {p1, v0}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 52
    invoke-direct {p0}, Les/i7;->B()V

    return-void
.end method

.method public a(Lorg/apache/http/HttpResponse;Lcom/android/volley/k;)[B
    .locals 11
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const-string p2, "AudioDownloadRequest"

    const-string v0, "AudioDownloadRequest handle response"

    .line 3
    invoke-static {p2, v0}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    const/4 v0, 0x0

    if-eqz p1, :cond_9

    .line 4
    invoke-interface {p1}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v1

    if-eqz v1, :cond_9

    .line 5
    invoke-interface {v1}, Lorg/apache/http/HttpEntity;->getContentLength()J

    move-result-wide v2

    .line 6
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "AudioDownloadRequest file size:"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v4, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {p2, v4}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 7
    iget-object v4, p0, Les/i7;->s:Ljava/io/File;

    invoke-virtual {v4}, Ljava/io/File;->length()J

    move-result-wide v4

    .line 8
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "AudioDownloadRequest downloaded size:"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v6, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {p2, v6}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 9
    invoke-static {p1}, Les/va;->a(Lorg/apache/http/HttpResponse;)Z

    move-result v6

    const/4 v7, -0x1

    if-eqz v6, :cond_0

    add-long/2addr v2, v4

    const-string v8, "Content-Range"

    .line 10
    invoke-static {p1, v8}, Les/va;->a(Lorg/apache/http/HttpResponse;Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    .line 11
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v8

    if-nez v8, :cond_0

    .line 12
    new-instance v8, Ljava/lang/StringBuilder;

    invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V

    const-string v9, "Content-Range : "

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v8, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-static {p2, v8}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 13
    new-instance p2, Ljava/lang/StringBuilder;

    invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v8, "bytes "

    invoke-virtual {p2, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p2, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v8, "-"

    invoke-virtual {p2, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-wide/16 v8, 0x1

    sub-long v8, v2, v8

    invoke-virtual {p2, v8, v9}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    .line 14
    invoke-static {p1, p2}, Landroid/text/TextUtils;->indexOf(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)I

    move-result p1

    if-ne p1, v7, :cond_0

    .line 15
    iget-object p1, p0, Les/i7;->t:Ljava/io/File;

    invoke-static {p1}, Lcom/esfile/screen/recorder/utils/i;->a(Ljava/io/File;)Z

    .line 16
    iget-object p1, p0, Les/i7;->s:Ljava/io/File;

    invoke-static {p1}, Lcom/esfile/screen/recorder/utils/i;->a(Ljava/io/File;)Z

    return-object v0

    :cond_0
    const-wide/16 p1, 0x0

    cmp-long v8, v2, p1

    if-lez v8, :cond_1

    .line 17
    iget-object v8, p0, Les/i7;->t:Ljava/io/File;

    invoke-virtual {v8}, Ljava/io/File;->length()J

    move-result-wide v8

    cmp-long v10, v8, v2

    if-nez v10, :cond_1

    .line 18
    iget-object p1, p0, Les/i7;->t:Ljava/io/File;

    iget-object p2, p0, Les/i7;->s:Ljava/io/File;

    invoke-virtual {p1, p2}, Ljava/io/File;->renameTo(Ljava/io/File;)Z

    .line 19
    invoke-direct {p0, v2, v3, v4, v5}, Les/i7;->a(JJ)V

    return-object v0

    .line 20
    :cond_1
    new-instance v8, Ljava/io/RandomAccessFile;

    iget-object v9, p0, Les/i7;->s:Ljava/io/File;

    const-string v10, "rw"

    invoke-direct {v8, v9, v10}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V

    if-eqz v6, :cond_2

    .line 21
    invoke-virtual {v8, v4, v5}, Ljava/io/RandomAccessFile;->seek(J)V

    goto :goto_0

    .line 22
    :cond_2
    invoke-virtual {v8, p1, p2}, Ljava/io/RandomAccessFile;->setLength(J)V

    move-wide v4, p1

    .line 23
    :goto_0
    :try_start_0
    invoke-interface {v1}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object p1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    if-eqz p1, :cond_4

    const/16 p2, 0x1400

    :try_start_1
    new-array p2, p2, [B

    .line 24
    :cond_3
    invoke-virtual {p1, p2}, Ljava/io/InputStream;->read([B)I

    move-result v6

    if-eq v6, v7, :cond_4

    const/4 v9, 0x0

    .line 25
    invoke-virtual {v8, p2, v9, v6}, Ljava/io/RandomAccessFile;->write([BII)V

    int-to-long v9, v6

    add-long/2addr v4, v9

    .line 26
    invoke-direct {p0, v2, v3, v4, v5}, Les/i7;->a(JJ)V

    .line 27
    invoke-virtual {p0}, Lcom/android/volley/Request;->u()Z

    move-result v6

    if-eqz v6, :cond_3

    .line 28
    invoke-direct {p0}, Les/i7;->A()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_1

    :catchall_0
    move-exception p2

    move-object v0, p1

    goto :goto_4

    :cond_4
    :goto_1
    if-eqz p1, :cond_5

    .line 29
    :try_start_2
    invoke-virtual {p1}, Ljava/io/InputStream;->close()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_2

    :catch_0
    move-exception p1

    .line 30
    sget-boolean p2, Les/u6;->a:Z

    if-eqz p2, :cond_5

    .line 31
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    .line 32
    :cond_5
    :goto_2
    :try_start_3
    invoke-interface {v1}, Lorg/apache/http/HttpEntity;->consumeContent()V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_1

    goto :goto_3

    :catch_1
    move-exception p1

    .line 33
    sget-boolean p2, Les/u6;->a:Z

    if-eqz p2, :cond_6

    .line 34
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    .line 35
    :cond_6
    :goto_3
    invoke-static {v8}, Lcom/esfile/screen/recorder/utils/i;->a(Ljava/io/Closeable;)V

    goto :goto_7

    :catchall_1
    move-exception p2

    :goto_4
    if-eqz v0, :cond_7

    .line 36
    :try_start_4
    invoke-virtual {v0}, Ljava/io/InputStream;->close()V
    :try_end_4
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_2

    goto :goto_5

    :catch_2
    move-exception p1

    .line 37
    sget-boolean v0, Les/u6;->a:Z

    if-eqz v0, :cond_7

    .line 38
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    .line 39
    :cond_7
    :goto_5
    :try_start_5
    invoke-interface {v1}, Lorg/apache/http/HttpEntity;->consumeContent()V
    :try_end_5
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_3

    goto :goto_6

    :catch_3
    move-exception p1

    .line 40
    sget-boolean v0, Les/u6;->a:Z

    if-eqz v0, :cond_8

    .line 41
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    .line 42
    :cond_8
    :goto_6
    invoke-static {v8}, Lcom/esfile/screen/recorder/utils/i;->a(Ljava/io/Closeable;)V

    .line 43
    throw p2

    :cond_9
    :goto_7
    return-object v0
.end method

.method public f()Ljava/util/Map;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/android/volley/AuthFailureError;
        }
    .end annotation

    .line 1
    iget-object v0, p0, Les/i7;->r:Ljava/util/Map;

    return-object v0
.end method

.method protected z()V
    .locals 5

    .line 1
    iget-object v0, p0, Les/i7;->r:Ljava/util/Map;

    const-string v1, "Range"

    invoke-interface {v0, v1}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    .line 2
    iget-object v0, p0, Les/i7;->r:Ljava/util/Map;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "bytes="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v3, p0, Les/i7;->s:Ljava/io/File;

    invoke-virtual {v3}, Ljava/io/File;->length()J

    move-result-wide v3

    invoke-virtual {v2, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v3, "-"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method
